package com.kly.interview.constant;

import com.kly.interview.model.entity.User;
import lombok.Data;

/**
 * @author admin
 * @date 2025/4/28
 */
@Data
public class UserContext {
    private static ThreadLocal<User> tl = new ThreadLocal<>();

    public static void setUser(User user) {
        tl.set(user);
    }

    public static User getUser() {
        return tl.get();
    }

    public static void removeUser() {
        tl.remove();
    }
}
